package proxy;

import javax.security.auth.Subject;

public class ProxyTest {
    public static void main(String[] args) {
        IImage image = new ImageStaticProxy("test.jpg");
        image.display();
        System.out.println("===========================");
        ImageProxyHandler proxy = new ImageProxyHandler();
        //绑定该类实现的所有接口
        IImage iImage = (IImage) proxy.bind(new RealImage("test.jpg"));
        iImage.display();
    }
}
